Ternary 三元運算子


Posted by Rich on 2021-04-22

console.log(10 > 5 ? 'bigger' : 'smaller')
output:bigger

condition ? true : false
條件 ? true就執行 : false就執行


#note







Related Posts

同步 & 非同步(5) - Promise.all 與 並行

同步 & 非同步(5) - Promise.all 與 並行

Ubuntu18.04 yolov3 tiny 轉 onnx 使用 Python 3.6.9

Ubuntu18.04 yolov3 tiny 轉 onnx 使用 Python 3.6.9

SQL-injection lab(10)

SQL-injection lab(10)


Comments